$OpenBSD: patch-configure_in,v 1.2 2012/06/01 15:57:51 ajacoutot Exp $

Clean up symbol visibility.

--- configure.in.orig	Sun Apr 20 16:33:43 2008
+++ configure.in	Fri Jun  1 02:53:20 2012
@@ -58,6 +58,30 @@ AM_PROG_LIBTOOL
 
 
 dnl ---------------------------------------------------------------------
+dnl Have GCC's -fvisibility option?
+dnl ---------------------------------------------------------------------
+AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
+have_gcc_fvisibility=no
+visibility_CFLAGS="-fvisibility=hidden"
+save_CFLAGS="$CFLAGS"
+CFLAGS="$save_CFLAGS $visibility_CFLAGS"
+AC_TRY_COMPILE([
+#if !defined(__GNUC__) || __GNUC__ < 4
+#error SDL only uses visibility attributes in GCC 4 or newer
+#endif
+],[
+],[
+have_gcc_fvisibility=yes
+])
+AC_MSG_RESULT($have_gcc_fvisibility)
+CFLAGS="$save_CFLAGS"
+
+if test x$have_gcc_fvisibility = xyes; then
+    CFLAGS="$CFLAGS $visibility_CFLAGS"
+fi
+
+
+dnl ---------------------------------------------------------------------
 dnl Debug mode?
 dnl ---------------------------------------------------------------------
 
@@ -222,9 +246,9 @@ AC_ARG_ENABLE(ogg,
               , enable_ogg=yes)
 if test x$enable_ogg = xyes; then
   AC_CHECK_HEADER(vorbis/codec.h, have_vorbis_hdr=yes)
-  AC_CHECK_LIB(vorbis, vorbis_info_init, have_vorbis_lib=yes)
+  AC_CHECK_LIB(vorbis, vorbis_info_init, have_vorbis_lib=yes,,[-logg])
   AC_CHECK_HEADER(vorbis/vorbisfile.h, have_vorbisfile_hdr=yes)
-  AC_CHECK_LIB(vorbisfile, ov_open_callbacks, have_vorbisfile_lib=yes)
+  AC_CHECK_LIB(vorbisfile, ov_open_callbacks, have_vorbisfile_lib=yes,,[-lvorbis -logg])
   have_vorbis=no
   if test x$have_ogg = xyes; then
     if test x$have_vorbis_hdr = xyes -a x$have_vorbis_lib = xyes; then
@@ -259,7 +283,7 @@ AC_ARG_ENABLE(flac,
               , enable_flac=yes)
 if test x$enable_flac = xyes; then
   AC_CHECK_HEADER(FLAC/stream_decoder.h, have_flac_hdr=yes)
-  AC_CHECK_LIB(FLAC, $flcsym, have_flac_lib=yes)
+  AC_CHECK_LIB(FLAC, $flcsym, have_flac_lib=yes,,[-logg])
   if test x$have_ogg = xyes; then
     if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
       LIBS="$LIBS -lFLAC -logg"
